package xin.ssm.jxc.servicesImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import xin.ssm.jxc.dao.GoodsPurchaseMapper;
import xin.ssm.jxc.model.GoodsPurchase;
import xin.ssm.jxc.services.IPurchaseService;
@Service
public class PurchaseService implements IPurchaseService {
	@Resource
	private GoodsPurchaseMapper goodsPurchaseMapper;

	@Override
	public List<GoodsPurchase> findGoodsPurchaseDynamic(GoodsPurchase gp) {
		// TODO Auto-generated method stub
		return goodsPurchaseMapper.findGoodsPurchaseDynamic(gp);
	}

	@Override
	public int deletePurchase(int purchaseid) {
		// TODO Auto-generated method stub
		return goodsPurchaseMapper.deleteByPrimaryKey(purchaseid);
	}

	@Override
	public int addPurchase(GoodsPurchase gp) {
		// TODO Auto-generated method stub
		return goodsPurchaseMapper.insertSelective(gp);
	}

	@Override
	public int updatePurchase(GoodsPurchase gp) {
		// TODO Auto-generated method stub
		return goodsPurchaseMapper.updateByPrimaryKeySelective(gp);
	}
}
